package sjtu.rfid.rri.services.tag;

import java.io.Serializable;
import java.util.List;

public class TagModel implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2535463008876371912L;

	private List<Bank> banks;
	// for quick usage! Hex Data
	private String EPCTagMemory;

	/**
	 * @return the banks
	 */
	public List<Bank> getBanks() {
		return banks;
	}

	/**
	 * @param banks
	 *            the banks to set
	 */
	public void setBanks(List<Bank> banks) {
		this.banks = banks;
	}

	/**
	 * @return the ePCTagMemory
	 */
	public String getEPCTagMemory() {
		return EPCTagMemory;
	}

	/**
	 * @param tagMemory
	 *            the ePCTagMemory to set
	 */
	public void setEPCTagMemory(String tagMemory) {
		EPCTagMemory = tagMemory;
	}

	@Override
	public int hashCode() {
		int result = 17;
		if (null != banks) {
			result = 37 * result + banks.hashCode();
		}
		if (null != EPCTagMemory) {
			result = 37 * result + EPCTagMemory.hashCode();
		}
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof TagModel))
			return false;

		TagModel tagModel = (TagModel) obj;
		return (banks == null ? tagModel.banks == null : banks
				.equals(tagModel.banks))
				&& (EPCTagMemory == null ? tagModel.EPCTagMemory == null
						: EPCTagMemory.equals(tagModel.EPCTagMemory));
	}

	@Override
	public String toString() {
		return "tagModel[banks=" + banks + ",EPCTagMemory=" + EPCTagMemory
				+ "]";
	}

}
